package com.jsz.peini.common.util;

import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.text.NumberFormat;

/**
 * @author Han Guohong
 * @version 2017-2-20 下午4:14:18
 * 类说明
 */
public class NumberFormatUtil {

	public static String format2RMB(Double number){
		DecimalFormat df=(DecimalFormat)NumberFormat.getInstance();
		//df.setMaximumFractionDigits(2);
		df.applyPattern("0.00");
		String str = df.format(number);
		return str;
	}
	
	public static BigDecimal ceilFormat(BigDecimal money){
		//BigDecimal aa = new BigDecimal("7.7448522");
		money = money.multiply(new BigDecimal("100"));
		Double bb = Math.ceil(money.doubleValue());
		money = new BigDecimal(bb.toString());
		money = money.divide(new BigDecimal("100"));
		return money;
	}
}
